Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Support Ember 3.13.0 #662

Closed

Conversation

GavinJoyce
Copy link
Contributor

@GavinJoyce GavinJoyce commented Sep 23, 2019

This PR adds support for Ember 3.13.0

Screenshot 2019-09-23 at 13 27 18

There is one issue which might need to be resolved before this is merged:

@GavinJoyce GavinJoyce changed the title support Ember 3.13.0 Support Ember 3.13.0 Sep 23, 2019
@GavinJoyce GavinJoyce changed the title Support Ember 3.13.0 [WIP] Support Ember 3.13.0 Sep 23, 2019
@@ -1,16 +1,21 @@
import Ember from 'ember';

let __EMBER_METAL__;
if (Ember.__loader.registry['@ember/-internals/metal']) {
__EMBER_METAL__ = Ember.__loader.require('@ember/-internals/metal');
let emberMetalPaths = [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this lands we should close #653.

@offirgolan
Copy link
Collaborator

#642 - I'm currently skipping this test.

The test is related to this part of the code base:

https://github.com/offirgolan/ember-cp-validations/blob/2e901724390172d3b9584aec69696e2f8e28fc29/addon/validations/factory.js#L112-L117

And is pretty much testing that if there is no super class with a validations mixin, it shouldnt call this._super at all. This was related to a bug that was found some time ago that @rwjblue helped solve. Pretty much, if you instantiated the validations object within an ember action, it will call this._super on that action which would invoke that action's parent method.

@offirgolan
Copy link
Collaborator

We can skip the test for now and come back for this later if it means we can merge this and unblock everyone else.

@offirgolan
Copy link
Collaborator

@GavinJoyce is this PR still WIP?

.travis.yml Outdated
@@ -3,7 +3,7 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- '6'
- '10'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably use 8 (minimum supported Node) and do this in a separate PR to drop Node 6 support (will be breaking). Will also need to tweak the engines.node entry in package.json.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to get this unblocked in a non-breaking way we could also run the scenarios for Ember 3.13 and above on node_js: 10 and keep the others at node_js: 6 for now until we actually drop support

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with @Turbo87's suggestion and pinned the new scenarios at 8. I'll follow up with another to drop Node 6.

'@ember/-internals/metal', // ember-source from 3.10
'@ember/-internals/metal/index' // ember-source from 3.13
];
let metalPath = emberMetalPaths.find(path => Ember.__loader.registry[path]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, we shouldn't use Array.prototype.find if we still intend for this library to support IE11 (I'm not sure if we do though?).

Possible future refactor would be to swap this to using ember-compatibility-helpers so we don't need iterative looping.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Papered this over with Ember.A for now.

}

export function getDependentKeys(descriptorOrDecorator) {
if (__EMBER_METAL__ && __EMBER_METAL__.descriptorForDecorator) {
let descriptor = __EMBER_METAL__.descriptorForDecorator(
descriptorOrDecorator
);
return descriptor._dependentKeys;
return descriptor._dependentKeys || [descriptor.altKey];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What scenario is altKey used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure TBH. There are failing tests without it

@@ -633,6 +633,8 @@ function getCPDependentKeysFor(attribute, model, validations) {
dependentKeys.push('model.isDeleted');
}

dependentKeys = dependentKeys.filter(dependentKey => !!dependentKey);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependentKeys.filter(Boolean) ?

@Turbo87 Turbo87 mentioned this pull request Sep 26, 2019
@jrjohnson
Copy link
Contributor

This is our blocker for trying out the Octane preview. Anything I can do to help move this along?

@jrjohnson jrjohnson mentioned this pull request Oct 9, 2019
Temporary fix until node 6 support is dropped.
This is not included in Array in IE 11.
This was referenced Oct 14, 2019
@jrjohnson
Copy link
Contributor

Rebased in #668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants